package com.mapgoo.scalike

import scalikejdbc._
import scalikejdbc.config._

/**
  *
  * @author eureka.wh
  * @since 2019-05-30 18:28
  */
object Scalike02 {

  def main(args: Array[String]): Unit = {

    // DBs.setupAll()

    DB autoCommit { implicit session =>
      sql"create table boy(id int primary key,)"
    }

    // DBs.closeAll()

    println(myAutoCommit {x => "hell" + x})

    // myAutoCommit2("goland")
  }

  // 特殊函数
  def test:(Int => Boolean) = (_ % 2 == 0)

//  def study(String => String) = {
//    println("study...")
//  }

   def myAutoCommit(execution: String => String): String ={
//       var s: String = "welcome"
//       s
       "xxx"
    }

   def myAutoCommit2[T](a: T): Unit ={
      println(a)
   }
}


abstract class ScalikeDemo{

  def myAutoCommit[String](execution: DBSession => String)
}
